<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<% Html.RenderPartial("commonHeader"); %>

<script type="text/javascript">
    var i = 0;
    $(function() {
        $.getJSON("/test/jsontest.aspx", function(json) {

            var e = eval('(' + json + ')');
            $("#panel").html(json);
            SetJsonValue(e);
        });
    });
    function SetJsonValue(json, parent) {
        $.each(json, function(i, n) {
            if (typeof (n) != "object" || n == null) {
                var id = ((parent == null) ? "" : (parent + "_")) + i;
                var name = ((parent == null) ? "" : (parent + ".")) + i;
                $("#Div1").append(id + "<input id='" + id + "' name='" + name + "'/><br/>");
                $("#" + id).val(n == null ? "" : n);
            }
            else {
                SetJsonValue(n, i);
            }

        });
    }
</script>

<div id="panel">
    11111222111111111111111111111111111111</div>
<div id="Div1">
    11111111111222222222222222222</div>
